package gov.pbc.nn.kjgl.webService.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;

import com.bstek.bdf2.core.service.IDeptService;
import com.bstek.bdf2.core.service.IUserService;
import com.bstek.bdf2.core.service.impl.DefaultUserService;

@Component("myUserDetailsService")
public class myUserDetailsService implements UserDetailsService {

	@Autowired
	@Qualifier(IUserService.BEAN_ID)
	private IUserService userService;
	@Override
	public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
		// TODO Auto-generated method stub
		if(username.equals("admin"))
		{
			return userService.loadUserByUsername(username);
		}
		return null;
	}

}
